<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>洗衣房消毒签到列表</title>
	<#include "/common/resource.ftl">
</head>
<body>

<div class="ui-operation">
    <div class="ui-buttons">
        <div class="layui-btn-group tools">
            <@auth code='laundryRoomDisinfectionSign_add'><button class="layui-btn layui-btn-normal open-dialog" p="url:'${params.contextPath}/view/business/laundryRoomDisinfectionSign/laundryRoomDisinfectionSign_edit.htm',title:'添加洗衣房消毒签到表',width:'600px',height:'400px'"><i class="fa fa-plus"></i>添加</button></@auth>
            <@auth code='laundryRoomDisinfectionSign_update'><button class="layui-btn layui-btn-normal singleSelected" p="url:'${params.contextPath}/view/business/laundryRoomDisinfectionSign/laundryRoomDisinfectionSign_edit.htm',title:'编辑洗衣房消毒签到表',width:'600px',height:'400px'"><i class="fa fa-pencil"></i>修改</button></@auth>
            <@auth code='laundryRoomDisinfectionSign_delete'><button class="layui-btn layui-btn-normal remove-button" reurl="${params.contextPath}/web/laundryRoomDisinfectionSign/delete.json"><i class="fa fa-remove"></i>删除</button></@auth>
        </div>
    </div>
</div>
<div class="ui-content" style="padding-left: 10px;padding-right:10px;">
    <table id="datagrid" options="url:'${params.contextPath}/web/laundryRoomDisinfectionSign/list.json',params:'getSearchParams',dblClickRow:'showDetail'">
        <thead>
			<tr>
				<th data-options="field:'id',checkbox:true"></th>
				<th data-options="field:'name',width:300,align:'left'">签到人</th>
				<th data-options="field:'remark',width:450,align:'left'">备注</th>
				<th data-options="field:'createTimeStr',width:450,align:'left'">记录时间</th>
			</tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function getSearchParams() {
        return {name: $("input[name='name']").val()};
    }
    var showDetail = function (index, row) {
        <@auth code='laundryRoomDisinfectionSign_detail'>
            var url = "${params.contextPath}/view/business/laundryRoomDisinfectionSign/laundryRoomDisinfectionSign_detail.htm?id=" + row.id;
            DialogManager.openDialog("url:'" + url + "',title:'洗衣房消毒签到表详情',width:'600px',height:'200px'");
        </@auth>
    };
    //formatter:formatState
    function formatState(val, row) {
    }

    $(function () {
        $(".remove-button").click(function () {
            var ids = DataGrid.getCheckedIds();
            if (ids == "") {
                layer.msg("请选择删除记录")
                return false;
            }
            var url = $(this).attr("reurl");
            layer.confirm('确定删除记录', function () {
                $.ajaxRequest({
                    type: 'post',
                    url: url,
                    data: {ids: ids.join(",")},
                    success: function (data) {
                        $.message(data.message);
                        if (data.success) {
                            DataGrid.reload();
                        }
                    }
                });
            });
        });
    });
</script>
</body>

</html>
